#include <stdio.h>

#define LEN 1000001

int reverse(int n, int *digit)
{
	int r = 0, zeros = 0;
	while(n%10 == 0) {
		zeros++;
		n /=10;
	}
	while(n>0) {		
		r = r*10+n%10;
		n /= 10;
	}
	*digit = r;
	return zeros;
}

int main()
{
	char s[LEN];
	int i, n=1, digit = 0, zeros;
	for (i= 1; i<LEN; ) {
		zeros = reverse(n, &digit);		
		while (digit>0 && i<LEN) {
			s[i++] = '0' + digit%10;
			digit /= 10;
		}
		while(zeros--) s[i++] = '0';
		n++;
	}
	printf("%d\n", reverse(12, &digit));
	printf("%c %c %c %c %c\n", s[100], s[1000], s[10000], s[100000], s[1000000]);
}
